{extends file="./main.tpl"}
{block name=body}
<form name="driver" action="{$smarty.server.PHP_SELF}" method="post"> 
<table align="center" border="2" cellpadding="2" cellspacing="2" width="" > 
<tr>
  <td align="center" class="table1" colspan="10"><b>Money Transaction</b> </td>
</tr>
<tr>
  <td class="table2" align="right">Branch :</td> 
  <td class="table2" align="left" colspan="9"> 
  	<input type="text" value="{$branchNameSelected}" READONLY >
    <input type="hidden" name="branchIdSelected" value="{$branchIdSelected}" >
  </td>
</tr>
<tr>
  <td class="table2" align="right">Transaction In : </td>
  <td class="table2" align="left" colspan="10"> 
    <select name="transactionIn">
    <option value="0">Select Transaction In</option> 
      {html_options values=$transactionInArray.transactionInId output=$transactionInArray.transactionIn}
    </select>
   </td> 
</tr>
<tr> 
	<td class="table2" align="right">Party :</td>
  <td class="table2" align="left">
  	<select name="party" id="party" /> 
    <option value="0">Select Party</option>
      {html_options values=$partyArray.partyId output=$partyArray.name} 
    </select> 
  </td> 
  <td class="table2" align="right">Driver :</td> 
  <td class="table2"> 
  	<select name="driver"> 
    <option value="0">Select Driver</option>
      {html_options values=$driverArray.driverId output=$driverArray.driverName} 
   </select>
  </td>
  <td class="table2" align="right">Account Name :</td> 
  <td class="table2">
	  <select name="accountId"> 
	  <option value="0">Select Account</option> 
	    {html_options values=$accountArray.accountId output=$accountArray.accountName}
	  </select> 
 </td> 
 <td class="table2" align="right">Other :</td> 
 <td class="table2">
   <input type="text" name="other"></td>  
</tr> 
<tr>
  <td class="table2" align="" colspan="">Date :</td> 
  <td class="table2" > 
    {html_select_date prefix="moneyTrDate" start_year ="-0" end_year="+2" field_order="DMY" month_format="%m" day_value_format="%02d"} 
  </td>
</tr>
<tr>
  <td class="table2" align="right">Amount :</td> 
  <td class="table2"><input type="text" name="amount" ></td>
  <td class="table2">
  <select name="crDr"> 
    <option>Select</option> 
    <option name="cr">Cr</option> 
    <option name="dr">Dr</option> 
  </select>
  </td>
</tr>
<tr> 
  <td class="table2" align="right">Narration :</td> 
  <td class="table2" colspan="9"><textarea name="narration" cols=35 rows=5></textarea></td>
</tr> 
<tr> 
  <td class="table1" align="center" colspan="9"><input type="submit" name="insertBtn" value="Submit" class="button" /></td>
</tr>
</table>
<br />
<br />
<table align="center" border="2" cellpadding="2" cellspacing="2" width="" >
<tr>
   <td class="table2" align="center">Branch : </td>
   <td class="table2" align=""> 
    <select name="branchId" onchange="this.form.submit()">
    	<option value="0">All</option> 
      {html_options selected=$branchIdList values=$branchArray.branchId output=$branchArray.branchName}
    </select>
   </td> 
    <td class="table2" align="">Transaction In : </td>
  <td class="table2" align=""> 
    <select name="transactionInId" onchange="this.form.submit()">
    	<option value="0">All</option> 
      {html_options values=$transactionInListArray.transactionInId output=$transactionInListArray.transactionIn selected=$transactionIdSelected}
    </select>
   </td> 
</tr>
  <tr>
    <td align="center" class="table1" colspan="13"><b>Money Transaction</b></td>
  </tr>
  <tr>
    <td class="table1" NOWRAP ><b>Delete</b></td>
    <td class="table1" NOWRAP ><b>Branch</b></td>
    <td class="table1" NOWRAP ><b>Transaction In</b></td>
  	<td class="table1" NOWRAP ><b>Party</b></td>
    <td class="table1" NOWRAP ><b>Driver</b></td>
    <td class="table1" NOWRAP ><b>Account Name</b></td>
    <td class="table1" NOWRAP ><b>Other</b></td>
    <td class="table1" NOWRAP ><b>Date</b></td>
    <td class="table1" NOWRAP ><b>Amount Cr</b></td>
    <td class="table1" NOWRAP ><b>Amount Dr</b></td>
  	<td class="table1" NOWRAP ><b>Narration</b> </td>
  </tr>
  {section name="sec" loop=$moneyTransArray}
  <tr>
    <td class="table2" align="center"><a href="moneyTransDelete.php?moneyTransId={$moneyTransArray[sec].moneyTransId}" onclick="return confirm('You Want To Remove This Record');" class="link"> <img src="./images/deleteIco.png"></a></td>
    <td class="table2" NOWRAP >{$moneyTransArray[sec].branchName}</td>
    <td class="table2" NOWRAP >{$moneyTransArray[sec].transactionIn}</td>
    <td class="table2" NOWRAP >{$moneyTransArray[sec].name}</td>
    <td class="table2" NOWRAP >{$moneyTransArray[sec].driverName}</td>
    <td class="table2" NOWRAP >{$moneyTransArray[sec].accountName}</td>
    <td class="table2" NOWRAP align="right">{$moneyTransArray[sec].other}</td>
    <td class="table2" NOWRAP >{$moneyTransArray[sec].date}</td>
    {if $moneyTransArray[sec].crDr eq 'Cr'}
	    <td class="table2" NOWRAP align="right">{$moneyTransArray[sec].amount}</td>
	    <td class="table2" NOWRAP align="right">&nbsp;</td>
    {else}
	    <td class="table2" NOWRAP align="right">&nbsp;</td>
	    <td class="table2" NOWRAP align="right">{$moneyTransArray[sec].amount}</td>
    {/if}
    <td class="table2" NOWRAP >{$moneyTransArray[sec].narration}</td>
  </tr>
  {/section}
  <tr>
  	<td colspan="8" align="right" class="table1">Total</td>
  	<td class="table1" align="right"><b>{$totalCr}</b></td>
  	<td class="table1" align="right"><b>{$totalDr}</b></td>
    <td class="table1" colspan="2">&nbsp;</td>
  </tr>
  <tr>
  	<td colspan="8" align="right" class="table1">Total</td>
  	<td class="table1" align="center" colspan="2"><b>{$total}</b></td>
    <td class="table1" colspan="2">&nbsp;</td>
  </tr>
</table>
</form>
{/block}